package com.swyc.osschat.Test.designMode.prototype.impl;

/**
 * @description 老婆类 实现Cloneable接口
 * @Author: z156940l@outlook.com
 * @className Wife
 * @Date: 2022/7/25 18:14
 */
public class Wife implements Cloneable {
    private int age = 20;
    private int height = 165;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    //重写clone方法
    @Override
    public Wife clone() throws CloneNotSupportedException {
        return (Wife)super.clone();
    }

    @Override
    public String toString() {
        return "Wife{" +
                "age=" + age +
                ", height=" + height +
                '}';
    }
}
